from datetime import datetime, timedelta


def _today():
    import datetime
    today = datetime.date.today()
    td = today.strftime('%Y-%m-%d')
    dt = datetime.datetime.strptime(td, '%Y-%m-%d')
    return dt


start_adv_date = '04/15/2019'
end_adv_date = '04/21/2019'


dt = datetime.now()
dt_format = dt.strftime('%Y-%m-%d')
if not start_adv_date:
    start_adv_date = dt_format
else:
    start_adv_date = datetime.strptime(start_adv_date, '%m/%d/%Y')
    start_adv_date_format = start_adv_date.strftime('%Y-%m-%d')
    print("start_adv_date_format = " + start_adv_date_format)

if not end_adv_date:
    end_adv_date = dt_format
else:
    end_adv_date = datetime.strptime(end_adv_date, '%m/%d/%Y')
    end_adv_date_format = end_adv_date.strftime('%Y-%m-%d')
    print("end_adv_date_format = " + end_adv_date_format)


timedelta = end_adv_date - start_adv_date

delta_days = timedelta.days

dtt = datetime.now()

for iter_day in (1, delta_days):
    iter_date = datetime.timedelta(days=1) + dtt
    print("loop:"+iter_date.strftime('%Y-%m-%d'))



